<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__STATIC__/admin/css/pintuer.css">
<link rel="stylesheet" href="__STATIC__/admin/css/admin.css">
<script src="__STATIC__/admin/js/jquery.js"></script>
<script src="__STATIC__/admin/js/pintuer.js"></script>
<script src='http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'></script>
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/ueditor/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container');
</script>  

<!-- 动态增减input框 -->
<script>  
$(document).ready(function() {  
  
var MaxInputs       = 9; //maximum input boxes allowed  最大允许输入框
var InputsWrapper   = $("#InputsWrapper"); //Input boxes wrapper ID  输入框包装ID
var AddButton       = $("#AddMoreFileBox"); //Add button ID  添加按钮ID
  
var x = InputsWrapper.length; //initlal text box count  initlal文本框计算
var FieldCount=1; //to keep track of text box added  跟踪添加的文本框
  
$(AddButton).click(function (e)  //on add input button click  在添加输入按钮上单击
{  
        if(x <= MaxInputs) //max input box allowed  最大允许输入框
        {  
            FieldCount++; //text box added increment  文本框添加增量
            //add input box  添加输入框
            $(InputsWrapper).append('<div style="clear:left;"><input type="file" id="field_'+ FieldCount +'1" name="bigpic[]" class="input tips" style="width:25%; float: left; margin-bottom: 10px;"  value=""  data-toggle="hover" data-place="right" data-image="" /><input type="text" class="input w50" value="" name="alt[]" style="margin-left: 10px; margin-top: 3px;" /><button class="button bg-blue margin-left icon-minus removeclass" style="margin-top: 3px;"></button></div>');  
            x++; //text box increment  文本框增加
        }  
return false;  
});  
  
$("body").on("click",".removeclass", function(e){ //user click on remove text  用户点击删除文本。
        if( x > 1 ) {  
                $(this).parent('div').remove(); //remove text box  删除文本框
                x--; //decrement textbox  减量文本框
        }  
return false;  
})

$("body").on("click",".delpic", function(e){ //user click on remove text  用户点击删除文本。
    $(this).parent('div').remove(); //remove text box  删除文本框
})    
  
});  
</script>  


</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加内容</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="" enctype="multipart/form-data"> 

      <div class="form-group">
        <div class="label">
          <label>分类标题：</label>
        </div>
        <div class="field">
          <select name="cateid" class="input w50" data-validate="required:请选择分类">
            <option value="">请选择分类</option>

            {volist name='cate' id='category'}
              <option value="{$category.cateid}" {if condition='$category.cateid eq $list.cateid'} selected="selected" {/if}>
                <?php 
                  if($category['parentsid']!==0){echo "|".str_repeat('-',$category['level']*4);} 
                ?>
                {$category.name}
              </option>
            {/volist}

          </select>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$list.titlename}" name="titlename" data-validate="required:请输入标题" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>缩略图：</label>
        </div>
        <div class="field">
          <input type="file" id="url1" name="smallpic" class="input tips" style="width:25%; float:left;"  value=""  data-toggle="hover" data-place="right" data-image="{$list.smallpic}" />
          <!-- <div class="tipss">图片尺寸：500*500</div> -->
        </div>
      </div> 

      <div class="form-group">
        <div class="label">
          <label>图片展示：</label>
          <button class="button bg-blue icon-plus" id="AddMoreFileBox"></button>
          <p style="color:red;">(仅支持删除添加)</p>
        </div>
        <div class="field">
          <div id="InputsWrapper">
            {volist name='big' id='big'}
            <div style="clear:left;">
              <input type="test" name="bigpic[]" class="input tips" style="width:25%; margin-top: 7px; float: left; margin-bottom: 10px;"  value="{$big.bigpic}"  data-toggle="hover" data-place="right" data-image="{$big.bigpic}" />
              <input type="text" class="input w50" value="{$big.alt}" name="alt[]" style="margin-left: 10px; margin-top: 7px;" />
              <!-- <button class="button bg-blue margin-left icon-plus" id="AddMoreFileBox" style="margin-top: 3px;" ></button> -->
              <button class="button bg-blue margin-left icon-times delpic" style="margin-top: 7px;"></button>
            </div>
              {/volist}
            
          </div>
        </div>
      </div>    

      <div class="form-group">
        <div class="label">
          <label>其他属性：</label>
        </div>
        <div class="field" style="padding-top:8px;"> 
          首页 <input name="position[]"  type="checkbox" value="1" {if condition="strpbrk($list.position,'1')"} checked {/if}/>
          推荐 <input name="position[]"  type="checkbox" value="2" {if condition="strpbrk($list.position,'2')"} checked {/if}/>
          置顶 <input name="position[]"  type="checkbox" value="3" {if condition="strpbrk($list.position,'3')"} checked {/if}/> 
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>描述：</label>
        </div>
        <div class="field">
          <textarea class="input" name="sketch" style=" height:90px;">{$list.sketch}</textarea>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>内容：</label>
        </div>
        <div class="field">
          <textarea name="content" id="container" style="height:450px; border:1px solid #ddd;">{$list.content}</textarea>
          <div class="tips"></div>
        </div>
      </div>
     
      <div class="clear"></div>
      <div class="form-group">
        <div class="label">
          <label>关键字标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="title" value="{$list.title}" />
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>内容关键字：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="keywords" value="{$list.keywords}"/>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>关键字描述：</label>
        </div>
        <div class="field">
          <textarea type="text" class="input" name="description" style="height:80px;">{$list.description}</textarea>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>作者：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="author" value="{$list.author}"  />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>排序：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="picsort" value="{$list.picsort}"  data-validate="number:排序必须为数字" />
          <div class="tips"></div>
        </div>
      </div> 
      <!-- <div class="form-group">
        <div class="label">
          <label>发布时间：</label>
        </div>
        <div class="field"> 
          <script src="js/laydate/laydate.js"></script>
          <input type="text" class="laydate-icon input w50" name="datetime" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" value=""  data-validate="required:日期不能为空" style="padding:10px!important; height:auto!important;border:1px solid #ddd!important;" />
          <div class="tips"></div>
        </div>
      </div> -->
      <!-- <div class="form-group">
        <div class="label">
          <label>点击次数：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="views" value="" data-validate="member:只能为数字"  />
          <div class="tips"></div>
        </div>
      </div> -->
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

</body></html>